<div class="p-head">
    <b class="c3">日记</b>
    <div class="r">
        <a href="/bbs/index/3/" class="ajax" title="意见反馈">意见反馈</a>
    </div>
    <div id="desc">
        记录每天生活的点点滴滴。。。
    </div>
</div>
<div class="tabs_t tabs_n">
    <ul class="ajax" id="tabs_l">
        <li class="<?= $family ? '' : 'current' ?>"><a href="/diary/index/">我的日记</a></li>                        
        <li class="<?= $family ? 'current' : '' ?>"><a href="/diary/index/1/">家庭日记</a></li>
    </ul>
    <span class="r clear">
        <a href="/diary/add/" title="写日记" class="btn btn_s dialog" callback="diary_callback"><span><b class="icon icon-edit"></b><em>新增日记</em></span></a>
    </span>
</div>
<div id="diary">
    <table class="data list" cellpadding="0" cellspacing="1" width="100%" style="margin-bottom:0;">
        <?php foreach ($list as $k => $v) { ?>
            <tr>
                <td width="10"><a href="javascript:;" title="<?= $v['star'] ? '取消星标' : '添加星标' ?>" class="star <?= $v['star'] ? 'star_current' : '' ?>" sid="<?= $v['id'] ?>" surl="/diary/star/<?= $v['id'] ?>/">星标日记</a></td>
                <td class="datatitle">
                    <a href="/diary/show/<?= $v['id'] ?>/" class="ajax"><?= $v['title'] ?></a><br />
                    <div class="intro"><?= $v['content'] ?></div>
                </td>
                <td width="90" class="dataedit">
                    <?= format_time($v['createtime']) ?>
                    <br />
                    <?php if ($v['user_id'] == $user['id']) { ?>
                        <a href="/diary/edit/<?= $v['id'] ?>/" class="dialog" title="编辑日记" close="true" callback="diary_callback"> 编辑</a> | 
                        <a href="/diary/del/<?= $v['id'] ?>/" class="del" title="删除"> 删除</a>
                    <?php } else { ?>
                        <?php if ($family) { ?>
                            <?= isset($family_list[$v['user_id']]['nickname']) ? $family_list[$v['user_id']]['nickname'] : '未知' ?>
                        <?php } ?>
                    <?php } ?>
                </td>
            </tr>
        <?php } ?>
        <tr>
            <td colspan="3" style="padding:0;">
                <div class="pager graybg ajax">
                    <?= $pagelist ?> 
                </div>
            </td>
        </tr>
    </table>
</div>
<script type="text/javascript">
    KS.common.load('diary.index');
</script>